<?php
    include('./library/conn.php');

    $phone = $_REQUEST['phone'];
    $password = $_REQUEST['password'];

    if($password !== ''){

		$select = "select * from users where phone='$phone' and password='$password'";
	
		$result = $mysqli->query($select);
	
		$mysqli->close();
	
		if($result->num_rows>0){
			echo '{"has":true}';
		}else{
			echo '{"has":false}';
		}
	
	}else{

		$select2 = "select * from users where phone='$phone'";

		$result2 = $mysqli->query($select2);

		$mysqli->close();

		if($result2->num_rows>0){
			echo '{"has":true}';
		}else{
			echo '{"has":false}';
		};
	};

?>